	
	<?php  if(isset($rows)) : foreach($rows as $row) : ?>
	<div id="edit_form">
	<h2>Ändra</h2>
<?php

	foreach ($moods as $m) {
		$mood_options[$m->moodID]=$m->moodName;
	}
	foreach ($categories as $c) {
		$category_options[$c->categoryID]=$c->categoryName;
	}
	echo form_open('site/edit_entry_form/'.$row->entryID); 
	echo validation_errors(); 
	echo form_input('headline', $row->headline);
	$data = array(
		'name' => 'text',
		'rows' => 5,
		'cols' => 32,
		'maxlength' => 200,
		'value' => $row->text
	);
	echo form_textarea($data);
	echo form_input('author',  $row->author);

	echo form_dropdown('mood', $mood_options, $row->moodID);
	echo form_dropdown('category', $category_options, $row->categoryID);

	echo form_submit('submit',  'Ändra');
	echo form_close();
?>
	</div>
	<?php endforeach; ?>
	<?php else : ?>	
		<h2>No records were returned.</h2>
	<?php endif; ?>
	